set -e
/usr/bin/expect -c 'set timeout -1; spawn pyinstaller -F -w app.spec --clean;expect -re "Continue?|moving BUNDLE data files" {send "y\n"};expect eof'
FN=LogViewer$1.tar.gz

echo "copying files..."
ditto tool dist/LogViewer.app/Contents/tool
ditto images dist/LogViewer.app/Contents/images
ditto qss dist/LogViewer.app/Contents/qss 
echo "zipping files..."
cd dist/
tar -czf $FN *.app
echo "Finished."
open .
exit

